package com.smart.context;

import com.smart.Car;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericGroovyApplicationContext;

/**
 * @author chenxingyu
 * @date 2019/8/26 11:12
 */
public class GroovyApplicationContextTest {
    @Test
    public void getBean() {
        ApplicationContext ctx = new GenericGroovyApplicationContext("classpath:com/smart/context/groovy-beans.groovy");
        Car car = (Car) ctx.getBean("car");
        Assert.assertNotNull(car);
        System.out.println(car);
    }
}
